package com.example.baseproject.main;

import android.Manifest;
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.Uri;
import android.nfc.NfcAdapter;
import android.os.Build;
import android.view.View;
import android.widget.Toast;

import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.core.app.ActivityCompat;
import androidx.core.splashscreen.SplashScreen;

import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ObjectUtils;
import com.blankj.utilcode.util.PathUtils;
import com.blankj.utilcode.util.SDCardUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.example.baseproject.R;
import com.example.baseproject.databinding.ActivityMainBinding;
import com.example.baseproject.easyhttptest.TestViewModel;
import com.hjq.http.EasyHttp;
import com.tjcd.project.library_base.base.activity.BaseActivity;
import com.tjcd.project.library_base.common.utils.ValueChangeUtils;
import com.tjcd.project.library_base.room.bean.UserBean;
import com.tjcd.project.library_base.room.dao.UserDao;
import com.tjcd.project.library_base.room.utils.RoomUtil;

import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import cn.com.heaton.blelibrary.ble.Ble;
import cn.com.heaton.blelibrary.ble.callback.BleScanCallback;
import cn.com.heaton.blelibrary.ble.model.BleDevice;
import cn.com.heaton.blelibrary.ble.model.ScanRecord;
import cn.com.heaton.blelibrary.ble.utils.UuidUtils;
import io.reactivex.rxjava3.subjects.BehaviorSubject;

/**
 * @Author: jiangKunKun
 * @CreateDate: 2022/8/5
 * @Description:
 * @SpittingGrooves
 */
public class MainActivity extends BaseActivity<ActivityMainBinding, TestViewModel>{

    private UserDao mUserDao;
    private BluetoothAdapter bluetoothAdapter;
    private NfcAdapter mNfcAdapter;

    /**
     * 通用的Contract,不做任何转换，Intent作为输入，ActivityResult作为输出，这也是最常用的一个协定
     */
    ActivityResultLauncher<Intent> mStartActivityForResult = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() {
        @Override
        public void onActivityResult(ActivityResult result) {
            if (null == result.getData()){
                LogUtils.e("asd = 空data");
                return;
            }
            LogUtils.e("asd = " + result.getData().getStringExtra("key"));
        }
    });
    /**
     * 通用的Contract,不做任何转换，Intent作为输入，ActivityResult作为输出，这也是最常用的一个协定
     */
    ActivityResultLauncher<Intent> mStartActivityForResult1 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() {
        @Override
        public void onActivityResult(ActivityResult result) {
            if (null == result.getData()){
                LogUtils.e("asd = 空data");
                return;
            }
            LogUtils.e("asd = " + result.getData().getStringExtra("key"));
        }
    });
    /**
     * 获取多个动态权限，成功后返回boolean数组
     *  Manifest.permission.BLUETOOTH,
     *  Manifest.permission.NFC,
     *  Manifest.permission.ACCESS_FINE_LOCATION,
     */
    ActivityResultLauncher<String[]> mRequestMultiplePermissions = registerForActivityResult(new ActivityResultContracts.RequestMultiplePermissions(), new ActivityResultCallback<Map<String, Boolean>>() {
        @Override
        public void onActivityResult(Map<String, Boolean> result) {

        }
    });
    /**
     * 获取单个动态权限，成功后返回true
     */
    ActivityResultLauncher<String> mRequestPermission = registerForActivityResult(new ActivityResultContracts.RequestPermission(), new ActivityResultCallback<Boolean>() {
        @Override
        public void onActivityResult(Boolean result) {
        }
    });
    /**
     * 调用MediaStore.ACTION_IMAGE_CAPTURE拍照，返回值为Bitmap图片
     */
    ActivityResultLauncher<Void> mTakePicturePreview = registerForActivityResult(new ActivityResultContracts.TakePicturePreview(), new ActivityResultCallback<Bitmap>() {
        @Override
        public void onActivityResult(Bitmap result) {
        }
    });
    /**
     * 调用MediaStore.ACTION_IMAGE_CAPTURE拍照，并将图片保存到给定的Uri地址，返回true表示保存成功。
     */
    ActivityResultLauncher<Uri> mTakePicture = registerForActivityResult(new ActivityResultContracts.TakePicture(), new ActivityResultCallback<Boolean>() {
        @Override
        public void onActivityResult(Boolean result) {
        }
    });
    /**
     * 调用MediaStore.ACTION_VIDEO_CAPTURE 拍摄视频，保存到给定的Uri地址，返回一张缩略图
     */
    ActivityResultLauncher<Uri> mTakeVideo = registerForActivityResult(new ActivityResultContracts.TakeVideo(), new ActivityResultCallback<Bitmap>() {
        @Override
        public void onActivityResult(Bitmap result) {

        }
    });
    /**
     * 拍摄视频，将内容保存到开发者指定的Uri后，返回true
     */
    ActivityResultLauncher<Uri> mCaptureVideo = registerForActivityResult(new ActivityResultContracts.CaptureVideo(), new ActivityResultCallback<Boolean>() {
        @Override
        public void onActivityResult(Boolean result) {

        }
    });
    /**
     * 从通讯录APP获取联系人. 弹出手机联系人列表，用户选中其中一个后，返回Uri
     */
    ActivityResultLauncher<Void> mPickContact = registerForActivityResult(new ActivityResultContracts.PickContact(), new ActivityResultCallback<Uri>() {
        @Override
        public void onActivityResult(Uri result) {

        }
    });
    /**
     * 访问原始数据，返回Uri，例如相册中的单个图片
     */
    ActivityResultLauncher<String> mGetContent = registerForActivityResult(new ActivityResultContracts.GetContent(), new ActivityResultCallback<Uri>() {
        @Override
        public void onActivityResult(Uri result) {
        }
    });
    /**
     * 访问原始数据，返回Uri数组，例如相册中的多个图片
     */
    ActivityResultLauncher<String> mGetMultipleContents = registerForActivityResult(new ActivityResultContracts.GetMultipleContents(), new ActivityResultCallback<List<Uri>>() {
        @Override
        public void onActivityResult(List<Uri> result) {

        }
    });
    /**
     * 访问文件数据，打开文件夹，返回单个文件的Uri
     */
    ActivityResultLauncher<String[]> mOpenDocument = registerForActivityResult(new ActivityResultContracts.OpenDocument(), new ActivityResultCallback<Uri>() {
        @Override
        public void onActivityResult(Uri result) {

        }
    });
    /**
     * 提示用户选择文档（可以选择多个），分别返回它们的Uri，以List的形式。
     */
    ActivityResultLauncher<String[]> mOpenMultipleDocuments = registerForActivityResult(new ActivityResultContracts.OpenMultipleDocuments(), new ActivityResultCallback<List<Uri>>() {
        @Override
        public void onActivityResult(List<Uri> result) {

        }
    });
    /**
     * 提示用户选择一个目录，并返回用户选择的作为一个Uri返回，应用程序可以完全管理返回目录中的文档。
     */
    ActivityResultLauncher<Uri> mOpenDocumentTree = registerForActivityResult(new ActivityResultContracts.OpenDocumentTree(), new ActivityResultCallback<Uri>() {
        @Override
        public void onActivityResult(Uri result) {

        }
    });
    /**
     * 提示用户选择一个文档，返回一个(file:/http:/content:)开头的Uri。
     */
    ActivityResultLauncher<String> mCreateDocument = registerForActivityResult(new ActivityResultContracts.CreateDocument(), new ActivityResultCallback<Uri>() {
        @Override
        public void onActivityResult(Uri result) {

        }
    });

    @Override
    protected void beforeSetContent() {
        super.beforeSetContent();
        SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
        CeshiBean ceshiBean = new CeshiBean();
    }

    @Override
    protected Class<TestViewModel> setViewModelClass() {
        return TestViewModel.class;
    }

    HashMap<String, String> Sites = new HashMap<String, String>();
    private void initBle() {
        Ble ble = Ble.options()//开启配置
                .setLogBleEnable(true)//设置是否输出打印蓝牙日志（非正式打包请设置为true，以便于调试）
                .setThrowBleException(true)//设置是否抛出蓝牙异常 （默认true）
                .setAutoConnect(false)//设置是否自动连接 （默认false）
                .setIgnoreRepeat(false)//设置是否过滤扫描到的设备(已扫描到的不会再次扫描)
                .setConnectTimeout(10 * 1000)//设置连接超时时长（默认10*1000 ms）
                .setMaxConnectNum(7)//最大连接数量
                .setScanPeriod(100 * 1000)//设置扫描时长（默认10*1000 ms）
                .setUuidService(UUID.fromString(UuidUtils.uuid16To128("fd00")))//设置主服务的uuid（必填）
                .setUuidWriteCha(UUID.fromString(UuidUtils.uuid16To128("fd01")))//设置可写特征的uuid （必填,否则写入失败）
                .setUuidReadCha(UUID.fromString(UuidUtils.uuid16To128("fd02")))//设置可读特征的uuid （选填）
                .setUuidNotifyCha(UUID.fromString(UuidUtils.uuid16To128("fd03")))//设置可通知特征的uuid （选填，库中默认已匹配可通知特征的uuid）
                .create(activity, new Ble.InitCallback() {
                    @Override
                    public void success() {
                        LogUtils.e("asd = " + "初始化成功");
                    }

                    @Override
                    public void failed(int failedCode) {
                        LogUtils.e("asd = " + "初始化失败：" + failedCode);
                    }
                });
        ble.startScan(scanCallback);
    }
    BleScanCallback<BleDevice> scanCallback = new BleScanCallback<BleDevice>() {
        @Override
        public void onLeScan(final BleDevice device, int rssi, byte[] scanRecord) {
            //Scanned devices
                StringBuilder stringBuilder = new StringBuilder();
                if (ObjectUtils.isNotEmpty(device.getBleName())){
                    stringBuilder.append("设备名称:" + device.getBleName() + "\n");
                    stringBuilder.append("mac地址:" + device.getBleAddress() + "\n");
                    stringBuilder.append("Name:" + device.getBleName() + "\n");
                    stringBuilder.append("Alias:" + device.getBleAlias() + "\n");
                    stringBuilder.append("DeviceType:" + device.getDeviceType() + "\n");
                    stringBuilder.append("ConnectionState:" + device.getConnectionState() + "\n");
                    stringBuilder.append("rssi:" + rssi + "\n");
                    if ("ED:23:FA:93:3C:28".equals(device.getBleAddress())){
                        LogUtils.e( stringBuilder.toString());
                    }

                    Sites.put(device.getBleAddress(), stringBuilder.toString());
                }

        }

        @Override
        public void onStart() {
            super.onStart();
        }

        @Override
        public void onStop() {
            super.onStop();
            LogUtils.e("==============");
            Iterator<String> iterator = Sites.keySet().iterator();
            while (iterator.hasNext()) {
                String key = iterator.next();
                LogUtils.e(Sites.get(key));
            }
        }

        @Override
        public void onScanFailed(int errorCode) {
            super.onScanFailed(errorCode);
        }

        @Override
        public void onParsedData(BleDevice device, ScanRecord scanRecord) {
            super.onParsedData(device, scanRecord);
        }
    };

    @Override
    protected void init() {
        UserBean userBean = new UserBean();
        vBinding.ceshi.setOnClickListener(view -> {
            userBean.setId(1);
            userBean.setName("蒋坤坤");
            userBean.setUserId("测试");
//            vBinding.setUserBean(userBean);
//            LogUtils.e("asd = " + userBean.toString());
//            LogUtils.e("asd = " + ActivityUtils.getActivityList());
//            LogUtils.e("asd = " + mUserDao.queryUserAll());
//            ToastUtils.showShort("测试");
//            Intent intent = new Intent(activity, TwoActivity.class);
//            mStartActivityForResult.launch(intent);
            vModel.testOneBean();
//            vModel.testTwoBean();
//            vModel.testThreeBean();
//            vModel.fetchUserInfo(this, 100);
//            vModel.one();
        });

//        vModel.getLiveData().observe(this, new Observer<Resource<BaseHttpBean<TestOneBean>>>() {
//            @Override
//            public void onChanged(Resource<BaseHttpBean<TestOneBean>> baseHttpBeanResource) {
//                switch (baseHttpBeanResource.getStatus()) {
//                    case START:
//                        LogUtils.e("asd = " + baseHttpBeanResource.getStatus());
//                        break;
//                    case DATA_SUCCESS:
//                        if (baseHttpBeanResource.getData() != null) {
//                            LogUtils.e("asd = " + baseHttpBeanResource.getData().toString());
//                        }else {
//                            LogUtils.e("asd = " + baseHttpBeanResource.getData());
//                        }
//                        break;
//                    case DATA_FAIL:
//                        LogUtils.e("asd = " + baseHttpBeanResource.getCode());
//                        break;
//                    case ERROR:
//                        LogUtils.e("asd = " + baseHttpBeanResource.getMsg());
//                        break;
//                    case FINISH:
//                        LogUtils.e("asd = " + baseHttpBeanResource.getStatus());
//                        break;
//                }
//            }
//        });

        BehaviorSubject<String> subject = ValueChangeUtils.create("Another Initial Value");

        vBinding.tvTwo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                Intent intent = new Intent(activity, TwoActivity.class);
//                mStartActivityForResult1.launch(intent);
                EasyHttp.cancelByTag("关闭页面,继续请求");
            }
        });

        mUserDao = RoomUtil.sUserDao;
        if (Build.VERSION.SDK_INT >= 23) {
            int checkAccessFinePermission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.ACCESS_FINE_LOCATION);
            if (checkAccessFinePermission != PackageManager.PERMISSION_GRANTED) {
                ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.WRITE_EXTERNAL_STORAGE},
                        1);
                ToastUtils.showShort("没有权限，请求权限");
                return;
            }
            ToastUtils.showShort("已有定位权限");
        }

        //获取NfcAdapter对象，此方法与获取蓝牙适配器对象类似
        mNfcAdapter = NfcAdapter.getDefaultAdapter(getApplicationContext());
        if (mNfcAdapter == null) {
            Toast.makeText(this, "该设备不支持nfc", Toast.LENGTH_SHORT).show();
            finish();
            return;
        }
        if (!mNfcAdapter.isEnabled()) {
            startActivity(new Intent("android.settings.NFC_SETTINGS"));
            Toast.makeText(this, "设备未开启nfc", Toast.LENGTH_SHORT).show();
        }
        initBle();

////        vModel.fetchUserData();
        vModel.getTestOneBeanLiveData().observe(this, resource -> {
            switch (resource.getStatus()) {
                case START:
                    // 显示加载中提示
                    LogUtils.e("数据错乱one", resource.getStatus());
                    break;
                case DATA_SUCCESS:
                    // 更新UI，显示匹配数据
                    if (resource.getData() != null) {
                        LogUtils.e("数据错乱one", resource.getStatus(), resource.getData().toString());
                    }else {
                        LogUtils.e("数据错乱one", resource.getStatus(), "数据为空");
                    }
                    break;
                case DATA_FAIL:
                    // 更新UI，显示匹配数据
                    LogUtils.e("数据错乱one", resource.getCode(), resource.getMsg());
                    break;
                case ERROR:
                    // 显示错误信息
                    LogUtils.e("数据错乱one", resource.getStatus(), resource.getMsg());
                    break;
                case FINISH:
                    // 请求完成，隐藏加载提示
                    LogUtils.e("数据错乱one", resource.getStatus());
                    break;
            }
        });
////        vModel.testOneBean();
//        vModel.getTwoDataBean().observe(this, testTwoBeanResource -> {
//            switch (testTwoBeanResource.getStatus()) {
//                case START:
//                    // 显示加载中提示
////                    LogUtils.e("数据错乱two", testTwoBeanResource.getStatus());
//                    break;
//                case DATA_SUCCESS:
//                    // 更新UI，显示匹配数据
//                    LogUtils.e("数据错乱two", testTwoBeanResource.getStatus(), testTwoBeanResource.getData().toString());
//                    break;
//                case DATA_FAIL:
//                    // 更新UI，显示匹配数据
//                    LogUtils.e("数据错乱two", testTwoBeanResource.getCode(), testTwoBeanResource.getMsg());
//                    break;
//                case ERROR:
//                    // 显示错误信息
//                    LogUtils.e("数据错乱two", testTwoBeanResource.getStatus(), testTwoBeanResource.getMsg());
//                    break;
//                case FINISH:
//                    // 请求完成，隐藏加载提示
////                    LogUtils.e("数据错乱two", testTwoBeanResource.getStatus());
//                    break;
//            }
//        });
//        vModel.getThreeBean().observe(this, testThreeBeanResource -> {
//            switch (testThreeBeanResource.getStatus()) {
//                case START:
//                    // 显示加载中提示
//                    LogUtils.e("数据错乱three", testThreeBeanResource.getStatus());
//                    break;
//                case DATA_SUCCESS:
//                    // 更新UI，显示匹配数据
//                    if (testThreeBeanResource.getData() != null) {
//                        LogUtils.e("数据错乱three", testThreeBeanResource.getStatus(), testThreeBeanResource.getData().toString());
//                    }else {
//                        LogUtils.e("数据错乱three", testThreeBeanResource.getStatus(), "数据为空");
//                    }
//                    break;
//                case DATA_FAIL:
//                    // 更新UI，显示匹配数据
//                    break;
//                case ERROR:
//                    // 显示错误信息
//                    LogUtils.e("数据错乱three", testThreeBeanResource.getStatus(), testThreeBeanResource.getMsg());
//                    break;
//                case FINISH:
//                    // 请求完成，隐藏加载提示
//                        LogUtils.e("数据错乱three", testThreeBeanResource.getStatus());
//                    break;
//            }
//        });
//        vModel.testTwoBean();
//        RxJavaUtils.executeLoop(2000, () -> {
//            vModel.testOneBean();
//            vModel.testTwoBean();
//            vModel.testThreeBean();
//        });

        // 192.168.6.107
        String sendUdp = "#@#{\"body\":{\"code\":3701,\"value\":{\"device_code\":\"HCJGA125010005\",\"time\":1741521837080}},\"msg_type\":2}$";
//        UdpClient udpClient = null;
//        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
//            udpClient = UdpClient.create()
//                    .host("255.255.255.255")
//                    .port(9082)
//                    .handle(new BiFunction<>() {
//                        @Override
//                        public Publisher<Void> apply(UdpInbound udpInbound, UdpOutbound udpOutbound) {
//                            udpOutbound.sendString(Mono.just(sendUdp));
//                            udpInbound.receive().subscribe(new Consumer<ByteBuf>() {
//                                @Override
//                                public void accept(ByteBuf byteBuf) {
//                                    LogUtils.e("asd 接收数据 " + byteBuf.toString());
//                                }
//                            });
//                            return null;
//                        }
//                    });
//        }
//
//        udpClient.warmup() //<1>
//                .block();
//
//        Connection connection = udpClient.connectNow(Duration.ofSeconds(30)); //<2>
//
//        connection.onDispose()
//                .block();



//        vBinding.lav

    }

    @Override
    protected int attachLayoutRes(){
        return R.layout.activity_main;
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    private void pathInformation(){
        File externalFilesDir = getExternalFilesDir(null);
        // /storage/emulated/0/Android/data/com.example.baseproject/files/jkk/temp
        LogUtils.e("asd = " + externalFilesDir.getPath() + "/jkk/temp");
        LogUtils.e("asd 根据 Environment 获取 SD 卡路径= " + SDCardUtils.getSDCardPathByEnvironment());

        LogUtils.e("asd 获取根路径= " + PathUtils.getRootPath());
        LogUtils.e("asd 获取数据路径= " + PathUtils.getDataPath());
        LogUtils.e("asd 获取下载缓存路径= " + PathUtils.getDownloadCachePath());
        // /data/user/0/com.example.baseproject
        LogUtils.e("asd 获取内存应用数据路径= " + PathUtils.getInternalAppDataPath());
        LogUtils.e("asd 获取内存应用代码缓存路径= " + PathUtils.getInternalAppCodeCacheDir());
        LogUtils.e("asd 获取内存应用缓存路径= " + PathUtils.getInternalAppCachePath());
        LogUtils.e("asd 获取内存应用数据库路径= " + PathUtils.getInternalAppDbsPath());
        LogUtils.e("asd 获取内存应用文件路径= " + PathUtils.getInternalAppFilesPath());
        LogUtils.e("asd 获取内存应用 SP 路径= " + PathUtils.getInternalAppSpPath());
        LogUtils.e("asd 获取内存应用未备份文件路径= " + PathUtils.getInternalAppNoBackupFilesPath());
        LogUtils.e("asd 获取外存路径= " + PathUtils.getExternalStoragePath());
        LogUtils.e("asd 获取外存音乐路径= " + PathUtils.getExternalMusicPath());
        LogUtils.e("asd 获取外存播客路径= " + PathUtils.getExternalPodcastsPath());
        LogUtils.e("asd 获取外存铃声路径= " + PathUtils.getExternalRingtonesPath());
        LogUtils.e("asd 获取外存闹铃路径= " + PathUtils.getExternalAlarmsPath());
        LogUtils.e("asd 获取外存通知路径= " + PathUtils.getExternalNotificationsPath());
        LogUtils.e("asd 获取外存图片路径= " + PathUtils.getExternalPicturesPath());
        LogUtils.e("asd 获取外存影片路径= " + PathUtils.getExternalMoviesPath());
        LogUtils.e("asd 获取外存下载路径= " + PathUtils.getExternalDownloadsPath());
        LogUtils.e("asd 获取外存数码相机图片路径= " + PathUtils.getExternalDcimPath());
        // /storage/emulated/0/Android/data/com.example.baseproject
        LogUtils.e("asd 获取外存文档路径= " + PathUtils.getExternalDocumentsPath());
        LogUtils.e("asd 获取外存应用数据路径= " + PathUtils.getExternalAppDataPath());
        LogUtils.e("asd 获取外存应用缓存路径= " + PathUtils.getExternalAppCachePath());
        LogUtils.e("asd 获取外存应用文件路径= " + PathUtils.getExternalAppFilesPath());
        LogUtils.e("asd 获取外存应用音乐路径= " + PathUtils.getExternalAppMusicPath());
        LogUtils.e("asd 获取外存应用播客路径= " + PathUtils.getExternalAppPodcastsPath());
        LogUtils.e("asd 获取外存应用铃声路径= " + PathUtils.getExternalAppRingtonesPath());
        LogUtils.e("asd 获取外存应用闹铃路径= " + PathUtils.getExternalAppAlarmsPath());
        LogUtils.e("asd 获取外存应用通知路径= " + PathUtils.getExternalAppNotificationsPath());
        LogUtils.e("asd 获取外存应用图片路径= " + PathUtils.getExternalAppPicturesPath());
        LogUtils.e("asd 获取外存应用影片路径= " + PathUtils.getExternalAppMoviesPath());
        LogUtils.e("asd 获取外存应用下载路径= " + PathUtils.getExternalAppDownloadPath());
        LogUtils.e("asd 获取外存应用数码相机图片路径= " + PathUtils.getExternalAppDcimPath());
        LogUtils.e("asd 获取外存应用文档路径= " + PathUtils.getExternalAppDocumentsPath());
        LogUtils.e("asd 获取外存应用 OBB 路径= " + PathUtils.getExternalAppObbPath());
        LogUtils.e("asd 优先获取外部根路径= " + PathUtils.getRootPathExternalFirst());
        LogUtils.e("asd 优先获取外部数据路径= " + PathUtils.getAppDataPathExternalFirst());
        LogUtils.e("asd 优先获取外部文件路径= " + PathUtils.getFilesPathExternalFirst());
        LogUtils.e("asd 优先获取外部缓存路径= " + PathUtils.getCachePathExternalFirst());
    }

}